import java.util.ArrayList;

public class Selflearn_16 {
    public static void main(String[] args){
        ArrayList<String> a=new ArrayList<String>();
        a.add("first");
        a.add("second");
        for(String v: a){
            System.out.println(v);
        }
        a.add(1,"third");
        for(String v: a){
            System.out.println(v);
        }
    }
}
